package com.his.service.hy;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.his.dao.jpa.ResidentdoctorDao;
import com.his.pojo.HisResidentdoctor;

@Service
@Transactional
public class ResidentdoctorService {
	@Autowired
	private ResidentdoctorDao  residentdoctorDao;
	
	public List<HisResidentdoctor> selectResidentDocotorall(){
		List<HisResidentdoctor> list = residentdoctorDao.findAllHisResd();
		return copyResidentdoctor(list);
	}
	
	public List<HisResidentdoctor> copyResidentdoctor(List<HisResidentdoctor> list){
		List<HisResidentdoctor> l = new ArrayList<>();
		for(HisResidentdoctor r:list){
			HisResidentdoctor rd = new HisResidentdoctor();
			rd.setBqNo(r.getBqNo());
			rd.setZyysJob(r.getZyysJob());
			rd.setZyysName(r.getZyysName());
			rd.setZyysNo(r.getZyysNo());
			l.add(rd);
		}
		return l;
	}
	
}
